<?php
/**
 * @auther:周卫星
 * @date:2019/10/29
 * @fileName:add.blade.php
 * @fileDesc: 添加商户页面
 */
?>

@extends('admin_layout.layout')
@section('title', '修改商户')
@push('css')
@endpush

@push('js')
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=b2033c035d0b707892bd52f2ad6b61e9&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.CitySearch"></script>
    <script src="{{ Illuminate\Support\Facades\URL::asset('js/admin/biz/update.js') }}"></script>
@endpush
@section('content')
    <form class="layui-form" action="">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <input type="hidden" name="id" value="{{$id}}">
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>商户名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" value="{{$info['name']}}" required  lay-verify="required" placeholder="请输入商户名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商户分类</label>
            <div class="layui-input-block">
                <select name="category" lay-verify="required">
                    <option value="">请选择分类</option>
                    <option value="西餐" @if($info['category'] === "西餐") selected @else @endif>西餐</option>
                    <option value="粤菜" @if($info['category'] === "粤菜") selected @else @endif>粤菜</option>
                    <option value="湘菜" @if($info['category'] === "湘菜") selected @else @endif>湘菜</option>
                    <option value="清真口味" @if($info['category'] === "清真口味") selected @else @endif>清真口味</option>
                    <option value="风味特产" @if($info['category'] === "风味特产") selected @else @endif>风味特产</option>
                    <option value="自助餐" @if($info['category'] === "自助餐") selected @else @endif>自助餐</option>
                    <option value="韩国菜" @if($info['category'] === "韩国菜") selected @else @endif>韩国菜</option>
                    <option value="日本菜" @if($info['category'] === "日本菜") selected @else @endif>日本菜</option>
                    <option value="江浙菜" @if($info['category'] === "江浙菜") selected @else @endif>江浙菜</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>用户名</label>
            <div class="layui-input-block">
                <input type="text" name="username" value="{{$info['username']}}" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>联系人</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['truename']}}" name="truename" required  lay-verify="required" placeholder="请输入联系人" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>联系人电话</label>
            <div class="layui-input-block">
                <input type="tel" name="tel" value="{{$info['tel']}}" required  lay-verify="required" placeholder="请输入联系人电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>联系地址</label>
            <div class="layui-input-block">
                <input type="text" id="address" value="{{$info['address']}}" name="address" required  lay-verify="required" placeholder="请输入联系地址 eg:北京市朝阳区朝阳大悦城" autocomplete="off" class="layui-input">
                <input type="hidden" name="longitude" value="{{$info['longitude']}}">
                <input type="hidden" name="latitude"  value="{{$info['latitude']}}">
                <div id="selectMap" style="width: 50%; height: 300px"></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-block">
                <input type="text" name="idcard" value="{{$info['idcard']}}" placeholder="请输入身份号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证正面</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="idfront">
                    <i class="layui-icon">&#xe67c;</i>身份证正面上传
                </button>
                <div id="idfrontImg" class='viewImg' style="width: 50px;">
                    <img src='{{$info["idfront"]}}' style='width: 50px;'>
                </div>
                <input type="hidden" value="{{$info['idfront']}}" name="idfront" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证背面</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="idback">
                    <i class="layui-icon">&#xe67c;</i>身份证背面上传
                </button>
                <div id="idbackImg" class='viewImg' style="width: 50px;">
                    <img src='{{$info["idback"]}}' style='width: 50px;'>
                </div>
                <input type="hidden" value="{{$info['idback']}}" name="idback" placeholder="请输入联系人电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i style="color: red; font-size: 18px; padding-right: 5px">*</i>执照名称</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['business_license_name']}}" name="business_license_name" required  lay-verify="required" placeholder="请输入营业执照的名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">执照注册号</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['business_license_code']}}" name="business_license_code" placeholder="请输入营业执照的注册号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">注册地址</label>
            <div class="layui-input-block">
                <input type="text" name="business_license_address" value="{{$info['business_license_address']}}" placeholder="请输入营业执照的注册地址" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">有效期</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['business_license_expire']}}" name="business_license_expire" id="business_license_expire" placeholder="请选择营业执照的有限期" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">营业执照</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="businessImage">
                    <i class="layui-icon">&#xe67c;</i>营业执照上传
                </button>
                <div id="bLImage" class='viewImg' style="width: 50px;">
                    <img src='{{$info["business_license_image"]}}' style='width: 50px;'>
                </div>
                <input type="hidden" value="{{$info["business_license_image"]}}" name="business_license_image" placeholder="请输入联系人电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">许可证名称</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['catering_service_license_name']}}" name="catering_service_license_name" placeholder="请输入餐饮服务许可证的名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">许可编号</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['catering_service_license_no']}}" name="catering_service_license_no" placeholder="请输入餐饮服务许可证的许可编号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">许可地址</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['catering_service_license_address']}}" name="catering_service_license_address" placeholder="请输入餐饮服务许可证的许可地址" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">有效期</label>
            <div class="layui-input-block">
                <input type="text" value="{{$info['catering_service_license_expire']}}" name="catering_service_license_expire" id="catering_service_license_expire" placeholder="请选择餐饮服务许可证的有效期" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">许可证</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="cateringImage">
                    <i class="layui-icon">&#xe67c;</i>许可证上传
                </button>
                <div id="cImage" class='viewImg' style="width: 50px;">
                    <img src='{{$info['catering_service_license_image']}}' style='width: 50px;'/>
                </div>
                <input type="hidden" value="{{$info['catering_service_license_image']}}" name="catering_service_license_image" placeholder="请输入联系人电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="addBiz">修改</button>
            </div>
        </div>
    </form>
@endsection
